# msvc set filter
function(GroupSourcesByFolder target)
    get_target_property(sources ${target} SOURCES)
    foreach(file ${sources})
        get_filename_component(parent_dir "${file}" DIRECTORY)
        string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}" "" group "${parent_dir}")
        string(REPLACE "/" "\\" group "${group}")
        if ("${file}" MATCHES ".*\\.cpp")
            string(REPLACE "src" "" group "${group}")
        elseif("${file}" MATCHES ".*\\.h")
            include_directories(${parent_dir})
            string(REPLACE "include" "" group "${group}")
        endif()
        source_group("${group}" FILES "${file}")
    endforeach(file ${sources})
endfunction()